Page({
  data: {
    tle:"创建活动",
    subTle:"活动信息",
    activePage:1,
    se:3,
    indexTimeSelect:0
  },

  //切换页面内组件
  prev(){
    this.setData({
      activePage:this.data.activePage - 1 < 0 ? 0 : this.data.activePage - 1
    })
  },

  next(){
    this.setData({
      activePage:this.data.activePage + 1 > 3 ? 3 : this.data.activePage + 1
    });

    if(this.data.activePage == 3){

      this.setData({
        se:3
      })

      this.setT()
    }
  },

  //切换页面
  switchPage(){

    clearInterval(this.setTime);

    // my.navigateTo({url: '../activityList/activityList'});

    my.qn.switchTabEx({
      id: "page_list",
      complete: (res) => {
        console.log(res);
      },
    });

  },

  //进入投放完成页启动定时器
  setT(){
    
    clearInterval(this.setTime)
    
    this.setTime = setInterval(() => {
      this.setData({
        se:this.data.se - 1 < 0 ? 0 : this.data.se - 1
      })

      if(this.data.se <= 0){
        this.switchPage()
      }
    },1000)

  },

  onLoad() {},

  onHide(){
    clearInterval(this.setTime)
  },
});
